<html xmlns:g="grails">
<body>
	<a href="#">list</a>
	<div id="main"></div>

	<!-- Templates -->
	
	<script type="text/template" id="personProfileSimpleTemplate">
		<a href='#' class="personProfileSimple viewPerson" ><?= firstName ?> <?= lastName ?> (<?= emergencyContactsSize ?>)</a>
	</script>
	
	<script type="text/template" id="personProfileTemplate">
		Person firstName
		<input type="text" name="firstName" id="personFirstName" class="personProfile" value="<?= firstName ?>" />

		Person LastName
		<input type="text" name="lastName" id="personLastName" class="personProfile" value="<?= lastName ?>" />

		<span class='personProfile addEmergencyContact'><u>Add New Emergency Contact</u></span>

		<button class="personProfile" id='saveProfile'>Save Profile</button>
		<button class="personProfile" id='print'>Print</button>
	</script>

	<script type="text/template" id="emergencyContactTemplate">
		Emergency Contact <?= counter ?> - <span class="emergencyContact delete"><u>Remove</u></span><br />

		First Name: <br />
		<input type="text" size="10" name="firstName" class="emergencyContact" value="<?= firstName ?>" /> <br />

		Last Name: <br />
		<input type="text" size="10" name="lastName" class="emergencyContact" value="<?= lastName ?>" /><br />		
		
		<button class='emergencyContact addPhone'>Add Phone</button>
	</script>

	<script type="text/template" id="phoneTemplate">
		Phone <?= counter ?>
		<select name="phoneType" class="phone" >
			<option value="">Choose one</option>
			<g:each in="${phoneTypes}"><option>${it}</option></g:each>
		</select>
		Number <input type="text" size="8" maxlength="10" name="phone" class="phone" value="<?= phone ?>" />
		<span class="phone delete"><u>Remove</u></span>
	</script>


	<g:javascript library="vendor/json2" />
	<g:javascript library="vendor/jquery-1.6.4" />
	<g:javascript library="vendor/underscore" />
	<g:javascript library="vendor/backbone" />
	<g:javascript library="mahees-generic-bbone" />
	<g:javascript library="person/index" />
	<g:javascript>				
		var ui = new mahees.backbone.Router.PageRouter();
		Backbone.history.start();
	</g:javascript>
</body>
</html>